package main

import "fmt"

func main() {
	s := []int{0, 1, 2, 3, 4, 5, 6, 7}
	s = s[1:4] //包含1，但不含4
	fmt.Println(s)

	s = []int{0, 1, 2, 3, 4, 5, 6, 7}
	s = s[:2] //不含2
	fmt.Println(s)

	s = []int{0, 1, 2, 3, 4, 5, 6, 7}
	s = s[1:] //含1
	fmt.Println(s)

	//记忆：含头不含尾
}
